<div style="float:left;">
	<div class="follow-tag"></div>
	<div class="five columns sidebarhome aspages" id="fixed">
		<div class="sidinside">
			<div class="widget">
				<div class="h4bg"><h4 title="Search">搜索博客</h4></div>
				<div class="clear"></div>
				<form class="searchsidebar" id="searchsidebar" action="/search.php" method="get" target="_blank">
					<div>
						<p class="input-notice">输入一些东西来查找...</p>
						<input type="text" class="sinput" name="keywords"/>
						<input type="submit" class="sgo" value="搜索" />
					</div>
				</form>
			</div>
			<div class="widget">
				<div class="h4bg"><h4 title="Categories">博客分类</h4></div>
				<div class="clear"></div>
				<ul>
				<!--{foreach from=$cate item=val key=key}-->
					<li><a href='/blog-<!--{$val.cates}-->.html'><!--{$val.catename}--><font size="1">(<!--{$val.total}-->)</font></a></li>
				<!--{/foreach}-->
				</ul>
			</div>
			<div class="widget">
				<div class="h4bg"><h4>博文好评榜</h4></div>
				<div class="clear"></div>
				<ul>
				<!--{foreach from=$bang item=val key=key}-->
					<li><a href='/page-<!--{$val.id}-->.html'><!--{$val.title}--></a></li>
				<!--{/foreach}-->
				</ul>
			</div>
		</div>
	</div>
</div>
<style>
	*html{
		background-image:url(about:blank);
		background-attachment:fixed;
	}
	.fixed{position:fixed;top:1px;_position:absolute;_top:expression(eval(documentElement.scrollTop - 215));}
</style>
<script>

	if($('#fixed').height()+2 < $('#main').height())
	{
		$(window).scroll(function(){slider();});
	}

	$('form').load(function(){slider();});
	$('.input-notice').click(function(){
		$(this).siblings('input[name=keywords]').focus();
	});
	
	$('input[name=keywords]').val('')
							.focus(function(){$(this).siblings('.input-notice').hide();})
							.blur(function(){if(!this.value.replace(/(^\s*)|(\s*$)/g, "")){$(this).siblings('.input-notice').show();}});


	var tage=true;
	var h = 315;if(!+[1,])h = 295;//IE
	function slider()
	{
		var obj = $('#fixed');
		var scrolltop = $(window).scrollTop();
		var tagtop = $('.follow-tag').offset().top;
		if(scrolltop >= tagtop)
		{
			if(!obj.hasClass("fixed"))obj.addClass('fixed');
		}else{
			if(obj.hasClass("fixed"))obj.removeClass('fixed');
		}
		if((scrolltop + obj.height() + h) >= $(document).height())
		{
			obj.css({'position':'absolute','top':$(document).height()- obj.height() - 215 - h});tage=true;
		}else{
			if(tage)obj.css({'position':'','top':''});tage=false;	
		}
	}

	$('form[id=searchsidebar]').submit(function(){
		var k = $('input[name=keywords]').val();
		if(!k.replace(/(^\s*)|(\s*$)/g, ""))return false;
	})
</script>